Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support has many through #1

Open
wants to merge 35 commits into
base: support_has_many_through
Choose a base branch
from

Conversation

trevorrjohn
Copy link

Hey I just wanted to rebase your work so that it was ready to be merged.

excid3 and others added 30 commits February 15, 2023 20:05
* Test against Ruby 3.2

* Fix appraisal versions from upgrading themselves

* No longer test against Ruby 2.6

* Remove database alias for Rails 6.0 and Ruby 3.1 due to Pysch changes
Also, allow to pass a scope to acts_as_tenant
* Move Sidekiq 6 to its own appraisal

* Always test against the latest version of Sidekiq (7 currently)

* Remove Sidekiq 7 appraisal since it's the default
Adds a section on having your rails console automatically set the current tenant on load/reload while in development. I know this has saved our team a lot of time by reducing some dev friction.
* Replace RequestStore dependency with CurrentAttributes

* Update appraisals

* Update lib/acts_as_tenant.rb

* Update changelog
A new Active Record connection handler was added in Rails 6.1, however,
the old one remains the default for upgraded applications and throws
deprecation warnings under Rails 7
…deserialization of an ActiveJob to preserve the current tenant. (ErwinM#319)
Sidekiq best practices prefer JSON types and
GlobalID::Locator.locate works with the string
representation of GlobalID (which is a unique URI)

Co-authored-by: Ziad Sawalha <[email protected]>
* add a tenant change hook

* cleanup syntax for standardrb

---------

Co-authored-by: Christopher Winslett <[email protected]>
trevorrjohn and others added 5 commits January 19, 2024 17:30
While there is some support for "through" relationships, when finding
the association, the pluralized foreign key is used but join tables
use singular key names

BREAKING CHANGE
Given an assumption is being made that singular tenant/association names
are belongs_to and plural names are has_many, acts_as_tenant will no
longer attempt to create a new association if one already exists. This
will allow those with non-standard associations to manually define the
relationship
ActsAsTenant assumes that it needs to create an association with the
tenant unless a record already exists when calling the tenant
association. Unfortunately, until the parent record has been persisted,
Active Record will not be able to find the association using the tenant
association because the join record will not have an ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants